<!--
To change this template, choose Tools | Templates
and open the template in the editor.
-->
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title></title>
    </head>
    <body>
        <?php
        $conn= pg_connect("host=rigel.fca.unam.mx port=5432 dbname=li104000672 user=li104000672 password=KjZpYcQ");
        
            //$this->conexion= pg_connect("host=$host port=$port dbname=$db user=$user password=$password");
            
            if (!$conn) {
                echo "Logre conectarme";
                
                $sql = "SELECT * FROM persona";

                $sqlResult = pg_send_query($conn, $sql);
                
                $result = pg_get_result($conn);

                if (!pg_result_error($result)) {

                    $sqlResult = $result;

                } else {
                    echo "ERROR EN CONSULTA";
                }        
                
                $sqlResult = pg_fetch_all($sqlResult);
                
                $sqlResult = $sqlResult[0];
                
                echo "La consulta muestra : $sqlResult[0]";

                pg_close($conn);
        
            } else {
                echo "NO PUDE";
            }
        ?>
    </body>
</html>
